From d862c5c6dfa19501ad22ace7938af8f88cf993b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Mon, 16 Jan 2017 18:47:31 +0100 Subject: [PATCH] sizerequest: Use gtk_widget_measure to measure widget sizes --- gtk/gtksizerequest.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c index 1e16ea870e..3c58d34d14 100644 --- a/gtk/gtksizerequest.c +++ b/gtk/gtksizerequest.c @@ -143,9 +143,11 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget, gint minimum_height; gint natural_height; - /* Pull the base natural height from the cache as it's needed to adjust - * the proposed 'for_size' */ - gtk_widget_get_preferred_height (widget, &minimum_height, &natural_height); + /* Pull the base natural height from the cache as it's needed to adjust + * the proposed 'for_size' */ + gtk_widget_measure (widget, GTK_ORIENTATION_VERTICAL, -1, + &minimum_height, &natural_height, + NULL, NULL); /* convert for_size to unadjusted height (for_size is a proposed allocation) */ gtk_widget_adjust_size_allocation (widget, @@ -182,9 +184,11 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget, gint minimum_width; gint natural_width; - /* Pull the base natural width from the cache as it's needed to adjust - * the proposed 'for_size' */ - gtk_widget_get_preferred_width (widget, &minimum_width, &natural_width); + /* Pull the base natural width from the cache as it's needed to adjust + * the proposed 'for_size' */ + gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL, -1, + &minimum_width, &natural_width, + NULL, NULL); /* convert for_size to unadjusted width (for_size is a proposed allocation) */ gtk_widget_adjust_size_allocation (widget, -- 2.30.2